package com.xinghou.timer.common;



public abstract class AbstractConsumer {


	public void close() {
		ApplicationContext.exit();
	}

	protected  AbstractConsumer()
	{

	}

	public <T> T getBean(String name) {
		@SuppressWarnings("unchecked")
		T t = (T) ApplicationContext.getContext().getBean(name);
		return t;
	}

	public  <T> T getBean(Class<T> name) {
		T t = ApplicationContext.getContext().getBean(name);
		return t;
	}
	protected void start() {

	}


	protected abstract void doWork(String task);


}
